<#include "../common/_layout.html"/> <@head title="投诉与建议管理">
<style type="text/css">
.cll {
	background-color: #ddd;
}
</style>
</@head> <@layout menu='/complaintadvice'>
<!-- Content Header (Page header) -->
<section class="content-header">
	<h1>${pageTitleBread.department!pageTitleBread.default!}</h1>
	<ol class="breadcrumb">
		<li><a href="javascript:void(0);" onclick="location.href='${ctx}${pageTitleBread.breadHomeMethod!}'">首页</a></li>
		<li class="active">${pageTitleBread.nowBread!}</li>
	</ol>
</section>

<!-- Main content -->
<section class="content">
	<div class="row">
		<div class="col-xs-12">
			<div class="box">
				<form action="${ctx}/complaintadvice" id="listForm" method="post"
					role="form" class="form-inline">
					<div class="box-header">
						<h3 class="box-title">投诉与建议管理</h3>
						<div class="box-tools"></div>
					</div>
					<!-- /.box-header -->
					<div class="form-group">
						<label for="advtype">类型</label> <select name="advtype" class="form-control"
							id="advtype" style="width: 150px">
							<option value="">全部</option>
							<option value="0"<#if advtype??&&advtype=="0">selected="selected"</#if>>投诉举报</option>
							<option value="1"<#if advtype??&&advtype=="1">selected="selected"</#if>>意见建议</option>
							<option value="2"<#if advtype??&&advtype=="2">selected="selected"</#if>>其他</option>
						</select>
					</div>
					<div class="form-group">
						<label for="degree">程度</label> <select name="degree" id="degree" class="form-control"
							style="width: 120px">
							<option value="">全部</option>
							<option value="0"<#if degree??&&degree=="0">selected="selected"</#if>>一般</option>
							<option value="1"<#if degree??&&degree=="1">selected="selected"</#if>>严重</option>
							<option value="2"<#if degree??&&degree=="2">selected="selected"</#if>>非常严重</option>
						</select>
					</div>
					<div class="form-group">
						<label for="status">状态</label> 
						<select name="status" id="status" multiple="multiple" style="width: 360px">
							<option value="0">未指派</option>
							<option value="1">已处理</option>
							<option value="2">已指派</option>
							<option value="3">不予处理</option>
						</select>
					</div>
					<div class="form-group">
						<label for="reservation">时间段</label> <input type="text" class="form-control"
							name="reservation" id="reservation" style="width: 250px"
							value="${reservation!}">
					</div>
					<button class="btn btn-sm btn-default" value="查询">搜索</button>
					<div class="box-body table-responsive no-padding">
						<button type="button" id="deleteButton" disabled="disabled"
							class="btn btn-default"
							onclick="deleteAll('${ctx}/complaintadvice/delete')">删除
						</button>
						<button type="button" class="btn btn-default"
							onclick="location.href='${ctx}/complaintadvice/exportExcel?advtype=${advtype!}&status=${status!}&reservation=${reservation!}'">导出</button>
						<table class="table table-hover">
							<tr class="info">
								<th title=""><input type="checkbox" id="allCheck"></th>
								<th title="类型">类型</th>
								<th title="问题">问题</th>
								<th title="建议">建议</th>
								<th title="姓名">姓名</th>
								<th title="电话">电话</th>
								<th title="区域">区域</th>
								<th title="程度">程度</th>
								<th title="状态">状态</th>
								<th>操作</th>
							</tr>
							<#list page.getList() as item>
							<tr>
								<td><input type="checkbox" name="ids" value="${item.id!}"></td>
								<td><#if item.adv_type??&&item.adv_type==0>投诉举报</#if> <#if
									item.adv_type??&&item.adv_type==1>意见建议</#if> <#if
									item.adv_type??&&item.adv_type==2>其他</#if>
								<td>
								<#if item.content??&&item.content !="null">
									<#if item.content?length lt 20 >${item.content!}
									<#else>${item.content[0..*21]}...</#if>
								<#else>
								</#if>
								</td>
								<td>
								<#if item.advice??&&item.advice!="null">
									<#if item.advice?length lt 20 >${item.advice!}
									<#else>${item.advice[0..*21]}...</#if>
								<#else>
								</#if>
								</td>
								<td>${item.name!}</td>
								<td>${item.phone!}</td>
								<td>${item.areaname!}</td>
								<td>
									<#if item.degree??&&item.degree==0>一般</#if> <#if
									item.degree??&&item.degree==1>严重</#if> <#if
									item.degree??&&item.degree==2>非常严重</#if>
								<td><#if item.status??&&item.status==0>未指派</#if> 
									<#if item.status??&&item.status==1>已处理</#if> 
									<#if item.status??&&item.status==2>已指派</#if> 
									<#if item.status??&&item.status==3>不予处理</#if>
								<td>
									<button type="button" class="btn btn-info"
										onclick="location.href='${ctx}/complaintadvice/view?id=${item.id}'">
										<#if item.status??&&item.status==1>查看</#if>
										<#if item.status??&&item.status==2>处理</#if>
										<#if item.status==0||item.status==3>审核</#if>
								</td>
							</tr>
							</#list>
						</table>
						<#if (page.list?size>0)> <#include "../common/pager.html"> </#if>
					</div>
				</form>
			</div>
		</div>
	</div>
</section>
</@layout> <@scripts>
<script type="text/javascript" src="${ctx}/adminlte/plugins/bootbox/bootbox.min.js"></script>
<script type="text/javascript" src="${ctx}/js/list.js"></script>
<script type="text/javascript" src="${ctx}/adminlte/plugins/moment/moment.min.js"></script>
<script type="text/javascript" src="${ctx}/adminlte/plugins/moment/zh-cn.js"></script>
<script type="text/javascript" src="${ctx}/adminlte/plugins/daterangepicker/daterangepicker.js"></script>
<script type="text/javascript" src="${ctx}/adminlte/plugins/select2/select2.min.js"></script>
<script type="text/javascript" src="${ctx}/adminlte/plugins/select2/i18n/zh-CN.js"></script>
<script type="text/javascript">
    $(document).ready(function () {
    	moment.locale("zh-cn");
    	$('#reservation').daterangepicker({format: 'YYYY/MM/DD' , locale : {
                applyLabel: '确定',
                cancelLabel: '取消',
                fromLabel: '从',
                toLabel: '到',
                weekLabel: 'W',
                customRangeLabel: 'Custom Range',
                daysOfWeek: moment.weekdaysMin(),
                monthNames: moment.monthsShort(),
                firstDay: moment.localeData()._week.dow
    	 	}
    	 });
    	
    	$("#advtype").select2({
    		  minimumResultsForSearch: Infinity
    		});
    	$("#degree").select2({
    		  minimumResultsForSearch: Infinity
    		});
    	$("#status").select2({
    	  minimumResultsForSearch: Infinity
    	});
    	var stt = [${status}];
    	$("#status").val(stt).trigger("change");
    	
    	
    });
</script>
</@scripts>
